import java.io.IOException;
import java.io.ObjectOutputStream;
import java.net.Socket;

public class ServerSendThread extends Thread {
    private Socket socket;
    private Message message;
    private ObjectOutputStream oos;

    public ServerSendThread(Socket socket, Message message) {
        this.socket = socket;
        this.message = message;
    }

    @Override
    public void run() {

        try {
            oos = new ObjectOutputStream(socket.getOutputStream());
            oos.writeObject(message);
        } catch (IOException e) {
            e.printStackTrace();
        }
    }
}

